//
//  KAContactTipView.swift
//  kano
//
//  Created by Frank on 2024/11/6.
//

import UIKit
import ActiveLabel

class KAContactTipView: UIView {
    
    var handler: (()->())?
    
    lazy var tipTitle: UILabel = {
        tipTitle = UILabel()
        tipTitle.numberOfLines = 0
        tipTitle.text = ""
        tipTitle.font = UIFont.systemFont(ofSize: kscale(11), weight: .medium)
        tipTitle.textColor = .colorFF5B42
        
        
        return tipTitle
    }()
    
    init(with content: String) {
        super.init(frame: CGRectMake(0, 0, var_screenWidth, kscale(76)))
        let maxSize = CGSize(width: var_screenWidth-kscale(40), height: .greatestFiniteMagnitude)
        tipTitle.text = content
        let tipLabelH = tipTitle.sizeThatFits(maxSize).height
        self.height = tipLabelH + kscale(28)
        
        ka_setUI()
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func ka_setUI() {
        backgroundColor = .colorFFD0BF
        addSubview(tipTitle)
    
        tipTitle.snp.makeConstraints { make in
            make.left.equalTo(kscale(20))
            make.right.equalTo(kscale(-20))
            make.top.equalTo(kscale(14))
            make.bottom.equalTo(kscale(-14))
        }
    }
}

